﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Catalyst.Configuration
{
	public class TestConfiguration : ConfigurationSection
	{
		[ConfigurationProperty("databases", IsDefaultCollection = false)]
		[ConfigurationCollection(typeof(DatabaseElementCollection),
			AddItemName = "add",
			ClearItemsName = "clear",
			RemoveItemName = "remove")]
		public DatabaseElementCollection Databases
		{
			get
			{
				if (databases == null)
				{
					databases = (DatabaseElementCollection)base["databases"];
				}

				return databases;
			}
			set { databases = value; }
		}
	}

	public class TestElement : ConfigurationElement
	{
		[ConfigurationProperty("name", IsRequired = true)]
		public string Name
		{
			get { return this["name"].ToString(); }
		}

	}
}
